#ifndef __MAINWINDOW_H__
#define __MAINWINDOW_H__

#include <QtGui/QVBoxLayout>

#include <QtGui/QMainWindow>
#include <QtGui/QMenuBar>
#include <QtGui/QMenu>
#include <QtGui/QStatusBar>
#include <QtGui/QActionGroup>

#include "datawidget.h"
#include "visualwidget.h"
#include "configwidget.h"
#include "config.h"

namespace verema
{

/**
*  \brief This class provides an "empty body" of the verema tool. It includes the menu structure.
*		  Other widgets can be instantiated here.
*/
class MainWindow : public QMainWindow
{
	Q_OBJECT

	public:
		/**
		*  \brief Constructor
		*/
		MainWindow();

		/**
		*  \brief Destructor
		*/
		~MainWindow();

        /**
         * \brief function for reloading the widgets
         */
         void reloadWidgets();

	private slots:
		/**
		*  \brief Slot to activate/deactivate the dataView widget
		*  \param checked True if the data view was chosen, false if not.
		*/
		void dataView(bool checked);

		/**
		*  \brief Shows the ConfigWidget
		*/
		void configWidgetPG();
		void configWidgetDB();

		void newDatabase();

		/**
		 * \brief slot for changing the config
		 */
		void loadConfig();

		/**
		 * \brief slot for changing the database
		 */
        void loadDatabase();

	private:
		QWidget wdg_helper_widget;
		QVBoxLayout vbl_mainlayout;

		QMenuBar m_mainMenu;
		QMenu *m_fileMenu, *m_viewMenu, *m_configMenu, *m_helpMenu, *m_preferencesMenu;
		QAction *m_openData, *m_newData, /*m_saveData, *m_saveDataAs, */*m_exit,
			*m_visualView, *m_dataView, *m_documentation, *m_about,
			*m_preferencesDB, *m_preferencesPG;
		QActionGroup m_viewGroup;
		QStatusBar m_statusbar;

		DataWidget m_dataWidget;
		VisualWidget m_visualWidget;

		ConfigWidget m_configWidget;
};

} // namespace verema

#endif // __MAINWINDOW_H__
